import { DBType } from "./common";
import { InjectionKey, Ref } from "vue";
import { Generator } from "./interfaces";

// 数据库类型对应默认端口
const DB_TYPES: DBType[] = [
  { type: "MYSQL", port: 3306 },
  { type: "ORACLE", port: 1521 },
];

// 数据库连接缓存
const DB_CACHE: string = "databaseConfig";
// 生成器表单缓存
const GENERATOR_FORM_CACHE: string = "generatorForm";
// Token 缓存
const TOKEN_STORAGE = "token";
// Token 请求头
const TOKEN_HEADER = "Authorization";
// 生成器表单注入
const GENERATOR_INJECT: InjectionKey<Ref<Generator>> = Symbol("generatorForm");
// 数据库连接状态注入
const DB_CONNECTED_INJECT: InjectionKey<Ref<boolean>> = Symbol("dbConnected");

export {
  DB_TYPES,
  DB_CACHE,
  GENERATOR_FORM_CACHE,
  TOKEN_STORAGE,
  TOKEN_HEADER,
  GENERATOR_INJECT,
  DB_CONNECTED_INJECT,
};
